// 显示加载框
export function showLoading(title) {
  wx.showLoading({
    title: title
  })
}
// 隐藏加载框
export function hideLoading(param) {
  setTimeout(function () {
    wx.hideLoading()
  }, param)
}
//显示信息后自动隐藏
export function showingHide(title, time) {
  wx.showLoading({
    title: title
  })
  setTimeout(function () {
    wx.hideLoading()
  }, time)
}
//显示消息提示框
export function showToast(title, icon, duration) {
  wx.showToast({
    title: title,
    icon: 'none',
    duration: null==duration?1500:duration
  })
}
// 显示操作菜单
// itemList为数组【最大长度为6个】 eg: ['a','b ','c']
export function showActionSheet(itemList) {
  wx.showActionSheet({
    itemList: itemList,
    success(res) {
      console.log(res.tapIndex)
    },
    fail(res) {
      console.log(res.errMsg)
    }
  })
}
export function pageDelayJump(url, params, time) {
  if (params) {
    url +="?"+ params
  }
  if (!time) {
    time = 1000;
  }
  setTimeout(function () {
    wx.navigateTo({
      url: url,
    })
  }, time);
}
